package com.hotel.controller;

import com.hotel.pojo.User;
import com.hotel.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/jump")
public class JumpController {
    @Autowired
    UserService userService;
    @RequestMapping("/guests_add")
    public String guest(){
        return "guests_add";
    }

    @RequestMapping("/user_add")
    public String user(){
        return "user_add";
    }

    @RequestMapping("/home_add")
    public String home(){
        return "home_add";
    }

    @RequestMapping("/pwd_update")
    public ModelAndView pwd(Integer id){
        ModelAndView mv = new ModelAndView();
        User user = userService.queryUserById(id);
        mv.addObject("user",user);
        mv.setViewName("pwd_update");
        return mv;
    }

    @RequestMapping("/excel_down")
    public String excel(){
        return "excel_down";
    }

    @RequestMapping("/web_cache")
    public String cache(){
        return "web_cache";
    }

    @RequestMapping("/web_index")
    public String web_index(){
        return "web_index";
    }

    @RequestMapping("/index")
    public String index(){
        return "index";
    }

    @RequestMapping("/exit")
    public String exit(){
        return "exit";
    }

    @RequestMapping("/Yuding_add")
    public String check(){
        return "Yuding_add";
    }

    @RequestMapping("/check_add")
    public String yuding(){
        return "check_add";
    }


}
